

<?php
    $week_days = array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday');
    $transports = array('Bus', 'Boat', 'Jeep', 'Bus + Boat', 'Bus + Jeep', 'Bus + Canoe');


    $cnt = count($results);
    for ($i = 0; $i < $cnt; $i++):

        $exc_name = URLify::filter($results[$i]->name);
        $href = lang_url('excursions/' . $exc_name . '-' . $results[$i]->ID);
        $thumbnail = HOST_URL_HOTELS . $results[$i]->photo_path . '/thumb_207x136/' . $results[$i]->photo_name;

        $mytag_name = array();
        $mytag_id = array();
        foreach ($results[$i]->tags as $tag):
            $mytag_name[] = $tag->name;
            $mytag_id[] = $tag->ID;
        endforeach;


        if (!empty($mytag_name)):
            $mytag_name = implode(', ', $mytag_name);
            $mytag_id = implode(',', $mytag_id);

        else:
            $mytag_name = "";
            $mytag_id = "";

        endif;
        ?>
        <li class="js_item excursions_box" id="box-<?= $results[$i]->ID ?>" style="display: none" data-id='<?= $mytag_id ?>'>

            <div class="box clearfix gradient5">

                <div class="white_line"></div>

                <div class="tag-icon"><?= $mytag_name ?></div>

                <h2 class="exc_box_title"><a href="<?= $href ?>"><?= $results[$i]->name ?></a></h2>


                <div class="controls">
                    <a href="#myCarousel<?= $i ?>" data-slide="prev" class="prev pull-left carousel-control left">&nbsp;</a>
                    <a href="#myCarousel<?= $i ?>" data-slide="next" class="next pull-right carousel-control right">&nbsp;</a>
                </div>


                <div id="myCarousel<?= $i ?>" class="carousel slide" data-interval="false">

                    <!-- Carousel items -->
                    <div class="carousel-inner">
                        <?php
                        $z = TRUE;
                        foreach ($results[$i]->photos as $photo):

                            $thumbnail = HOST_URL_HOTELS . $results[$i]->photo_path . '/thumb_182x123/' . $photo->filename;
                            ?>    
                            <div class="item <?php if ($z) echo 'active'; ?>">
                                <a href="<?= $href ?>">
                                    <img src="<?= $thumbnail ?>">
                                </a>
                            </div>

                            <?php
                            $z = FALSE;
                        endforeach;
                        ?>
                    </div>

                </div>

                <div class="details request">

                    <ul>
                        <li><strong><?= lang('start_day') ?>:</strong> <?= implode(', ', explode(',', $results[$i]->startWeekDay)) ?></li>
                        <li><strong><?= lang('guides') ?>:</strong> <?= implode(', ', explode(',', $results[$i]->guides)) ?></li>
                        <li><strong><?= lang('transportation_type') ?>:</strong> <?= implode(', ', explode(',', $results[$i]->transports_title)) ?></li>
                        <li><strong><?= lang('addition') ?>:</strong> <?= implode(', ', explode(',', $results[$i]->addition)) ?></li>
                        <li><?= lang('sellingSeason') . '<strong>' . date('d.M', $results[$i]->season_start) . ' - ' . date('d.M', $results[$i]->season_end) . '</strong>.'; ?></li>
                    </ul>

                    <div class="realtime-exc">

                        <div class="result-price"><?= !isset($_GET['preview']) ? $results[$i]->adultPrice : $results[$i]->adultPrice; ?> &euro;<div class="from">&nbsp;/ <?= lang('per_person'); ?></div></div>

                        <a class="booknow request" href="<?= $href ?>"><?= lang('res.send_request'); ?></a>
                    </div>
                </div>

            </div>

        </li>

    <?php endfor; ?>